
Ext.onReady(function(){

Ext.QuickTips.init();

var mytree=new Ext.tree.TreePanel({

el:"tree-div",

animate:true,////展开,收缩动画,false时,则没有动画效果

title:"欢迎进入后台管理",

collapsible:true,//可折叠

enableDD:true,//不仅可以拖动,还可以通过Drag改变节点的层次结构

enableDrag:true,//树的节点可以拖动Drag

rootVisible:true,

autoScroll:true,

trackMouseOver:false,//false则mouseover无效果

//useArrows:true,//小箭头

autoHeight:true,

width:150,

lines:true //节点间的虚线条

//loader : new Tree.TreeLoader( {////加载节点数据

// dataUrl : 'OrgTreeJsonData.action'

//就是要动态载入数据的请求地址，这里请求时会提交一数为node的值，值为root即new Tree.AsyncTreeNode()对象的id值

// })

});

//根节点

var root=new Ext.tree.TreeNode({

id:"root",

text:"后台控制面板",

expanded:true

});

//第一个子节点及其子节点

var sub1=new Ext.tree.TreeNode({

id:"news",

text:"呼叫种类管理",

singleClickExpand:true

});

sub1.appendChild(new Ext.tree.TreeNode({

id:"addNews",

text:"添加呼叫种类",

href:"javascript:location.href='category_add.jsp'",

hrefTarget:"mainFrame",
qtip:"添加分类",//qtip:"提示"//提示信息,不过要 Ext.QuickTips.init();下
listeners:{//监听

"click":function(node,e){

href:"javascript:location.href='category_add.jsp'"
}
}
}));
sub1.appendChild(new Ext.tree.TreeNode({

id:"addcall",

text:"呼叫种类",

href:"javascript:location.href='index.jsp'",

hrefTarget:"mainFrame",
qtip:"种类管理",//qtip:"提示"//提示信息,不过要 Ext.QuickTips.init();下
listeners:{//监听

"click":function(node,e){

href:"javascript:location.href='index.jsp'"
}
}
}));
root.appendChild(sub1);
//第2个子节点及其子节点
var sub2=new Ext.tree.TreeNode({

id:"category",

text:"呼叫类别管理",

singleClickExpand:true

});

sub2.appendChild(new Ext.tree.TreeNode({

id:"add",

text:"添加呼叫类别",

href:"javascript:location.href='Pro_getCateAll.shtml'",

hrefTarget:"mainFrame",

qtip:"添加分类",//qtip:"提示"//提示信息,不过要 Ext.QuickTips.init();下

listeners:{//监听

"click":function(node,e){

href:"javascript:location.href='Pro_getCateAll.shtml'"
}

}

}));
sub2.appendChild(new Ext.tree.TreeNode({

id:"mrg",

text:"呼叫类别",

href:"javascript:location.href='sortInfo.jsp '",

hrefTarget:"mainFrame",

qtip:"类别管理",//qtip:"提示"//提示信息,不过要 Ext.QuickTips.init();下

listeners:{//监听

"click":function(node,e){

href:"javascript:location.href='sortInfo.jsp'"
}

}

}));
root.appendChild(sub2);

//第3个子节点及其子节点
var sub3=new Ext.tree.TreeNode({

id:"support",

text:"供应信息管理",

singleClickExpand:true

});

sub3.appendChild(new Ext.tree.TreeNode({

id:"addsupport",

text:"添加供应信息",

href:"javascript:location.href='Pro_getCallSortAll1.shtml'",

hrefTarget:"mainFrame",

qtip:"添加供应信息",//qtip:"提示"//提示信息,不过要 Ext.QuickTips.init();下

listeners:{//监听

"click":function(node,e){

href:"javascript:location.href='Pro_getCallSortAll1.shtml'"
}

}

}));
sub3.appendChild(new Ext.tree.TreeNode({

id:"mrgsupport",

text:"供应信息",

href:"javascript:location.href='provideinfo.jsp'",

hrefTarget:"mainFrame",

qtip:"供应信息",//qtip:"提示"//提示信息,不过要 Ext.QuickTips.init();下

listeners:{//监听

"click":function(node,e){

href:"javascript:location.href='provideinfo.jsp'"
}

}

}));
root.appendChild(sub3);
mytree.setRootNode(root);//设置根节点
mytree.render();//不要忘记render(),否则不显示

})

